package com.lightbend.akka

import akka.actor.{Actor, DeadLetter}

object DeadLetterMetricsActor {
  var count = 0
  def addCount = count += 1
}

class DeadLetterMetricsActor extends Actor {
  def receive:Receive = {
    case d: DeadLetter =>
      DeadLetterMetricsActor.addCount
      println(s"====> dmsg: ${d.message}, 死讯个数：${DeadLetterMetricsActor.count}")
  }
}